package com.enjoyor.soa.traffic.restt.tpcms.dubbo.impl;

import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Reference;
import com.enjoyor.soa.traffic.api.dto.tpcms.TemplateDto;
import com.enjoyor.soa.traffic.api.service.dubbo.tpcms.IDubboTemplateService;
import com.enjoyor.soa.traffic.restt.tpcms.dubbo.ITemplateConsumeService;
import com.enjoyor.soa.traffic.util.pojo.Page;
import com.enjoyor.soa.traffic.util.pojo.ResultPojo;

@Component
public class TemplateConsumeService implements ITemplateConsumeService {

    @Reference(version = "1.0.0", timeout = 10000)
    private IDubboTemplateService dubboTemplateService;

    public ResultPojo select(String id) {
        return dubboTemplateService.select(id);
    }

    public ResultPojo edit(TemplateDto template, String userName) {
        return dubboTemplateService.edit(template, userName);
    }

    public ResultPojo delete(String id, String userName) {
        return dubboTemplateService.delete(id, userName);
    }

    public ResultPojo insert(TemplateDto template, String userName) {
        return dubboTemplateService.insert(template, userName);
    }

    @SuppressWarnings("rawtypes")
    @Override
    public ResultPojo selectPage(Page page) {
        return dubboTemplateService.selectPage(page);
    }

    @Override
    public ResultPojo check(String token, String sysKey) {
        return dubboTemplateService.check(token, sysKey);
    }

}
